import {
  createRouter,
  createWebHashHistory
} from 'vue-router'

const routes = [{
    name: 'Error404',
    path: '/:error*',
    component: () => import('@/pages/error/404.vue')
  }, {
    path: '/login',
    name: 'Login',
    component: () => import('@/pages/login/index.vue'),
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/pages/register/index.vue'),

  },
  {
    path: '/findPassword',
    name: 'FindPassword',
    component: () => import('@/pages/password/index.vue'),

  },
  {
    path: '/policy',
    name: 'Policy',
    component: () => import('@/pages/constraint/policy.vue'),
  },
  {
    path: '/clause',
    name: 'Clause',
    component: () => import('@/pages/constraint/clause.vue'),

  },
  {
    path: '/medicine/service_license',
    name: 'ServiceLicense',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/file_proof',
    name: 'FileProof',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/medicine/tel_license',
    name: 'Tellicense',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/business_license',
    name: 'BusinessLicense',
    component: () => import('@/pages/license/index.vue'),
  },
  {
    path: '/',
    redirect: '/home',
    component: () => import('@/pages/index/index.vue'),
    children: [{
        path: '/home',
        name: 'Home',
        component: () => import('@/pages/home/index.vue')
      },
      {
        path: '/shoppingCart',
        name: 'ShoppingCart',
        component: () => import('@/pages/cart/index.vue')
      },
      {
        path: '/store',
        name: 'Store',
        component: () => import('@/pages/store/index.vue'),
        meta: {
          ori: 'store'
        }
      },
      {
        path: '/goodsList',
        name: 'GoodsList',
        component: () => import('@/pages/goods/list.vue')
      },
      {
        path: '/goods/:id',
        name: 'Goods',
        component: () => import('@/pages/goods/index.vue'),
        meta: {
          ori: 'goods'
        }
      },
      {
        path: '/goods/notFound',
        name: 'GoodsNotFound',
        component: () => import('@/pages/goods/not_found.vue')
      },

      {
        path: '/allOrder',
        name: 'AllOrder',
        component: () => import('@/pages/order/index.vue')
      },
      {
        path: '/settlement',
        name: 'Settlement',
        component: () => import('@/pages/settlement/index.vue')
      },
      {
        path: '/afterSale',
        name: 'AfterSale',
        component: () => import('@/pages/settlement/index.vue'),
      },
      {
        path: '/orderDetail/:id',
        name: 'OrderDetail',
        component: () => import('@/pages/order/detail.vue')
      },
      {
        path: '/search',
        name: 'Search',
        component: () => import('@/pages/search/index.vue')
      },
      {
        path: '/supplierQucalition',
        name: 'SupplierQucalition',
        component: () => import('@/pages/qualication/index.vue'),
        meta: {
          ori: 'qualica'
        }
      },
      {
        path: '/user',
        name: 'User',
        component: () => import('@/pages/user/index.vue')
      },


    ]
  }
]





export default createRouter({
  history: createWebHashHistory(),
  routes
})
